<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:pt="http://xmlns.jcp.org/jsf/passthrough"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
    
    <h:body>
    <ui:composition template="./Templates/TemplatePrincipal.xhtml">
    <ui:define name="topo"></ui:define>
    <ui:define name="content">
    <h:panelGroup layout="block" class="container">
    <p><br/></p>
        <h:panelGroup layout="block" class="row">
            <h:panelGroup layout="block" class="col-md-3"></h:panelGroup>
                <h:panelGroup layout="block" class="col-md-5">
                    <h:panelGroup layout="block" class="panel boxlogin panel-default">
                        <h:panelGroup layout="block" class="panel-body">
                            <h:panelGroup layout="block" class="page-header">
                                    <h3>Crie já sua Conta</h3>
                            </h:panelGroup>
                            <h:form role="form">
                                <h:panelGroup layout="block" class="form-group">
                                    <h:outputLabel value="Email ou Usuário"/>
                                    <h:panelGroup layout="block" class="input-group">
                                        <span class="input-group-addon"><span class="glyphicon glyphicon-envelope"></span></span>
                                        <h:inputText required="true" value="#{pessoaMB.pessoa.email}" maxlength="50" class="form-control"
                                            requiredMessage="Informe o usuario" pt:type="email=" pt:placeholder="Email"/>
                                    </h:panelGroup>
                                </h:panelGroup>
                                <h:panelGroup layout="block" class="form-group">
                                    <h:outputLabel value="Senha"/>
                                    <h:panelGroup layout="block" class="input-group">
                                        <span class="input-group-addon"><span class="glyphicon glyphicon-lock"></span></span>
                                        <h:inputSecret  required="true" value="#{pessoaMB.pessoa.senha}" maxlength="40" class="form-control" pt:placeholder="Senha"/>
                                    </h:panelGroup>
                                </h:panelGroup>
                                <h:commandButton value="Cadastrar" class="btn btn-success btn-block btn-lg">
                                    <f:ajax event="click" listener="#{pessoaMB.cadastroPessoa}" execute="@all" render="msg"/>
                                </h:commandButton>
                                    <p/>
                            </h:form> 
                            <h:form>
                                <h:commandLink value="Voltar" action="index" class="btn btn-info btn-block btn-lg"/>
                            </h:form>
                             <p/>
                            <h:messages id="msg"/>
                    </h:panelGroup>
                </h:panelGroup>
            </h:panelGroup>
        </h:panelGroup>
    </h:panelGroup>
    </ui:define>
<ui:define name="rodape"></ui:define>
</ui:composition>
</h:body>
</html>